package cn.iocoder.yudao.framework.pay.core.client.impl.pax.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 支付方式
 */
public enum PayMethodEnum {
    CALL_PAY("CALL_PAY"), // 通过sdk调起app支付
    WEB_PAY("WEB_PAY"), // 浏览器支付（pc/手机h5）
    QR_CODE_PAY("QR_CODE_PAY"), // 扫码支付
    ;

    private final String value;

    PayMethodEnum(String value) {
        this.value = value;
    }

    // Jackson deserialization method
    @JsonCreator
    public static PayMethodEnum fromValue(String value) {
        for (PayMethodEnum status : PayMethodEnum.values()) {
            if (status.value.equalsIgnoreCase(value)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid terminalType: " + value);
    }

    // Jackson serialization method
    @JsonValue
    public String getValue() {
        return value;
    }

}
